Skip to content

Remove default methods from CoreSpan; implement them in test doubles#11782

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
dougqh/corespan-coverage-exclude
Jun 30, 2026
Merged

Remove default methods from CoreSpan; implement them in test doubles#11782
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
dougqh/corespan-coverage-exclude

Conversation

@dougqh

@dougqh dougqh commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What This Does

Removes the default methods from CoreSpan

Motivation

The default methods on CoreSpan were effectively test-only methods, since they are overwritten by DDSpan

My preference is to not have test-only code in production classes. Given that these methods were causing coverage checks to fail, I thought it best to simply remove them.

Test plan

  • ./gradlew :dd-trace-core:jacocoTestCoverageVerification -PcheckCoverage no longer flags CoreSpan

🤖 Generated with Claude Code

dougqh and others added 2 commits June 29, 2026 10:46
…y DDSpan

The four defaults (getServiceNameSource, isKind, unsafeGetTag x2) are
unreachable in practice; DDSpan overrides each with a different implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The four defaults (getServiceNameSource, isKind, unsafeGetTag x2) were
unreachable in practice because DDSpan overrides each one. Making them
abstract forces test implementations to be explicit, and coverage is
satisfied by the concrete implementations rather than unreachable defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dd-octo-sts

dd-octo-sts Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.94 s 14.02 s [-1.5%; +0.4%] (no difference)
startup:insecure-bank:tracing:Agent 12.90 s 13.04 s [-1.8%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 16.70 s 16.66 s [-0.9%; +1.3%] (no difference)
startup:petclinic:iast:Agent 16.72 s 16.82 s [-1.6%; +0.4%] (no difference)
startup:petclinic:profiling:Agent 16.23 s 16.37 s [-7.1%; +5.4%] (unstable)
startup:petclinic:sca:Agent 16.71 s 16.46 s [+0.6%; +2.4%] (maybe worse)
startup:petclinic:tracing:Agent 15.91 s 15.67 s [-2.7%; +5.8%] (no difference)

Commit: 132b9196 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@dougqh dougqh changed the title Exclude CoreSpan from coverage Remove default methods from CoreSpan; implement them in test doubles Jun 29, 2026
@dougqh dougqh marked this pull request as ready for review June 29, 2026 16:36
@dougqh dougqh requested a review from a team as a code owner June 29, 2026 16:36
@dougqh dougqh requested a review from ygree June 29, 2026 16:36
@dd-octo-sts dd-octo-sts Bot added the tag: ai generated Largely based on code generated by an AI or LLM label Jun 29, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1117c7b82

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java
@bric3 bric3 added tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling type: bug Bug report and fix labels Jun 30, 2026
@bric3 bric3 enabled auto-merge June 30, 2026 10:19

@mcculls mcculls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplicate isKind implementations isn't ideal, but at least they shouldn't need updating once written (the production implementation in DDSpan is more important)

@bric3 bric3 force-pushed the dougqh/corespan-coverage-exclude branch from 00656dd to 132b919 Compare June 30, 2026 10:24
@bric3

bric3 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jun 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-30 11:12:37 UTC ℹ️ Start processing command /merge


2026-06-30 11:12:47 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-06-30 11:21:15 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-06-30 12:50:55 UTC ℹ️ MergeQueue: This merge request was merged

@bric3 bric3 added this pull request to the merge queue Jun 30, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jun 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-30 11:21:14 UTC ℹ️ Start processing command /merge


2026-06-30 11:21:16 UTC ❌ MergeQueue

PR already in the queue with status queued

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 30, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit b0cb50f into master Jun 30, 2026
583 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/corespan-coverage-exclude branch June 30, 2026 12:50
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants